// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
//   transpileDependencies: true
// })

'use strict'
const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

const name = '后台搭建'
module.exports = {
  publicPath: './',
  outputDir: 'dist',
  assetsDir: 'static',
  lintOnSave: false,
  productionSourceMap: false,
  devServer: {
    host: 'localhost',
    port: '8090',
    open: false,
    proxy: 'http://localhost:8090',
  },
  //配置环境：如果是生产环境默认加在路径前加‘./’，在打包文件index.html中的script标签，上线时要保证路径前没有'/'
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  filenameHashing: false, //关闭打包的js文件默认生成的哈希字符串
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [
        // 加上自己的路径
        path.resolve(__dirname, "./src/theme/style.less"),
      ],
    },
  },
  configureWebpack: {
    name: name,
    resolve: {
      alias: {
        // 设置@/的意义
        '@': resolve('src')
      }
    },
  }
}
